package com.itheima.common;


public class UserHolder {
    private static final ThreadLocal THREAD_LOCAL = new ThreadLocal();
    public static void setCurrentId(Long userId){
        THREAD_LOCAL.set(userId);
    }

    public static Long getCurrentId(){
        return (Long) THREAD_LOCAL.get();
    }

    public static void removeCurrentId(){
        THREAD_LOCAL.remove();
    }
}
